package com.st.book.controller;


import com.st.book.entity.Book;
import com.st.book.service.IBookService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author Hello
 * @since 2021-11-15
 */
@RestController
@RequestMapping("/book/book")
public class BookController {
    @Autowired
    private IBookService bookService;
    @Value("${server.port}")
    private int port;
    @RequestMapping(value = "/queryByIds",produces = "application/json;charset=utf-8")
    public Map queryByIds(String[] isbn){
        Map map=new HashMap();
        map.put("port",port);
        map.put("books",bookService.queryByIsbns(isbn));
        return map;
    }

}
